package com.huantai.auth.exception;

import lombok.Data;

/**
 * 业务处理异常
 */
@Data
public class BizException extends RuntimeException {

    private final String errorCode;

    public BizException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public BizException(BaseResult resultEnum) {
        super(resultEnum.getMessage());
        this.errorCode = resultEnum.getCode();
    }

    public BizException(BaseResult resultEnum, Object... keys) {
        super(String.format(resultEnum.getMessage(), keys));
        this.errorCode = resultEnum.getCode();
    }
}
